package com.example.moduletwo.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ListView;

import com.example.baselibrary.activity.BaseNewActivity;
import com.example.baselibrary.bean.PublicViewHolder;
import com.example.moduletwo.R;
import com.example.moduletwo.adapter.TestTwoAdapter;
import com.example.moduletwo.bean.BeanFive;
import com.example.moduletwo.bean.BeanTwo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sun.li on 2018/6/6.
 *
 * @author sun.li
 */

public class ModuleTwoMVPActivityListViewTwo extends BaseNewActivity {

    private TestTwoAdapter testTwoAdapter;

    private List<BeanTwo> list;

    private Context mContext;

    @Override
    protected int initLayoutRes() {
        return R.layout.activity_mvp_listview;
    }

    @Override
    protected PublicViewHolder initViewHolderObject() {
        return null;
    }

    @Override
    protected void baseOnClick(int viewId) {

    }

    @Override
    protected void initView(@Nullable Bundle bundle) {
        super.initView(bundle);
        mContext = this;
        list = new ArrayList<>();
        for (int i = 1; i <= 50; i++) {
            BeanTwo beanTwo = new BeanTwo();
            beanTwo.setStr1("item_"+i);
            beanTwo.setBeanFive(new BeanFive("item_five_1_"+i,"item_five_2_"+i));
            list.add(beanTwo);
        }
        testTwoAdapter = new TestTwoAdapter(mContext,list);

        ListView lv_aml_listview = findViewById(R.id.lv_aml_listview);
        lv_aml_listview.setAdapter(testTwoAdapter);

    }
}
